﻿using System.Collections.Generic;
using FrameworkManapro.BusinessModel;

namespace GMAC.ReportingSystem.Business.Entities
{
    [DbProcedures(Insert = "procUsersInsert", Update = "procUsersUpdate", Delete = "procUsersDelete")]
    public class User : BusinessEntity
    {
        /// <summary>
        /// Gets or sets the user ID.
        /// </summary>
        /// <value>The user ID.</value>
        [EntityPrimaryKey]
        [DbParameter(0, 1, 1)]
        public int UserID { get; set; }

        /// <summary>
        /// Gets or sets the role.
        /// </summary>
        /// <value>The role.</value>
        [DbParameter(1, 2, 0)]
        public Role Role { get; set; }
        
        ///<sumary>
        /// Gets or sets the Identification Number
        /// </sumary>
        /// <value>The Identification Number </value>
        [DbParameter(2, 3, 0)]
        public int IdentificationNumber { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [DbParameter(3, 4, 0)]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>The description.</value>
        [DbParameter(4, 5, 0)]
        public string Description { get; set; }

        
        public string FullName
        {
            get
            {
                return Name + " " + LastName;
            }
        }

        /// <summary>
        /// Gets or sets the department.
        /// </summary>
        /// <value>The department.</value>
        [DbParameter(5, 6, 0)]
        public string Department { get; set; }

              

        /// <summary>
        /// Gets or sets the email.
        /// </summary>
        /// <value>The email.</value>
        [DbParameter(6, 7, 0)]
        public string Email { get; set; }

        /// <summary>
        /// Gets or sets the login.
        /// </summary>
        /// <value>The login.</value>
        [DbParameter(7, 8, 0)]
        public string Login { get; set; }

        /// <summary>
        /// Gets or sets the password.
        /// </summary>
        /// <value>The password.</value>
        [DbParameter(8, 0, 0)]
        public string Password { get; set; }

        /// <summary>
        /// Gets or sets the status.
        /// </summary>
        /// <value>The status.</value>
        [DbParameter(9, 9, 0)]
        public bool Status { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the user must change his password.
        /// </summary>
        /// <value><c>true</c> if password must be changed; otherwise, <c>false</c>.</value>
        public bool MustChangePassword { get; set; }

        /// <summary>
        /// Gets or sets the count of invalid login attempts.
        /// </summary>
        /// <value>The count of invalid login attempts.</value>
        public byte LoginAttempts { get; set; }

        /// <summary>
        /// Gets or sets the lastname.
        /// </summary>
        /// <value>The lastname.</value>
        [DbParameter(10, 10, 0)]
        public string LastName { get; set; }
        

       
    }

    public class UserCollection : List<User>
    {
        public int TotalResults { get; set; }
    }
}
